//
//package com.rt.schedulebase.service.impl;
//
//import com.rt.schedulebase.entity.DictExamClass;
//
//import java.util.Collection;
//
//import com.rt.schedulenew.utils.base.CommonUtil;
//import org.apache.commons.lang3.StringUtils;
//import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
//import com.baomidou.mybatisplus.core.conditions.Wrapper;
//
//import java.util.Map;
//import java.util.HashMap;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//
//import java.util.List;
//
//import com.rt.schedulebase.dto.DictRoleFunctionDto;
//
//import java.io.Serializable;
//
//import org.springframework.stereotype.Service;
//import com.rt.schedulebase.service.IDictRoleFunctionService;
//import com.rt.schedulebase.entity.DictRoleFunction;
//import com.rt.schedulebase.mapper.DictRoleFunctionMapper;
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
//
//@Service
//public class DictRoleFunctionServiceImpl extends ServiceImpl<DictRoleFunctionMapper, DictRoleFunction> implements IDictRoleFunctionService {
//    @Override
//    public boolean insertSelective(DictRoleFunction dictRoleFunction) {
//        return retBool(Integer.valueOf(baseMapper.insert(dictRoleFunction)));
//    }
//
//    @Override
//    public boolean deleteByPrimaryKey(String key) {
//        return retBool(baseMapper.deleteById(key));
//    }
//
//    @Override
//    public boolean updateByPrimaryKeySelective(DictRoleFunction dictRoleFunction) {
//        return retBool(Integer.valueOf(baseMapper.updateById(dictRoleFunction)));
//    }
//
//    @Override
//    public DictRoleFunction selectByPrimaryKey(String key) {
//        return (DictRoleFunction) baseMapper.selectById((Serializable) key);
//    }
//
//    @Override
//    public List<DictRoleFunction> getList(DictRoleFunctionDto dto) {
//        QueryWrapper<DictRoleFunction> qw = new QueryWrapper();
//        Map<String, Object> map = new HashMap<String, Object>();
//        map.put("EXAM_CLASS", dto.getExamClass());
//        map.put("ROLE_ID", dto.getRoleId());
//        map.put("FUN_ID", dto.getFunId());
//        qw.allEq((Map) map, false);
//        List<DictRoleFunction> list = (List<DictRoleFunction>) baseMapper.selectList((Wrapper) qw);
//        return list;
//    }
//
//    @Override
//    public List<DictRoleFunction> getListAll() {
//        return (List<DictRoleFunction>) baseMapper.selectList((Wrapper) null);
//    }
//
//    @Override
//    public boolean delete(DictRoleFunction dictRoleFunction) {
//        Map<String, Object> map = new HashMap<String, Object>();
//        map.put("ROLE_ID", dictRoleFunction.getRoleId());
//        map.put("EXAM_CLASS", dictRoleFunction.getExamClass());
//        map.put("LIMIT_DAYS", dictRoleFunction.getLimitDays());
//        UpdateWrapper<DictRoleFunction> uw = new UpdateWrapper();
//        uw.allEq(map, false);
//        if (StringUtils.isNotBlank(dictRoleFunction.getFunId())) {
//            uw.in("FUN_ID", CommonUtil.split2List(dictRoleFunction.getFunId()));
//        }
//        return retBool(Integer.valueOf(baseMapper.delete((Wrapper) uw)));
//    }
//
//    @Override
//    public boolean update(DictRoleFunction dictRoleFunction) {
//        UpdateWrapper<DictRoleFunction> uw = new UpdateWrapper();
//        Map<String, Object> map = new HashMap<String, Object>();
//        map.put("ROLE_ID", dictRoleFunction.getRoleId());
//        map.put("EXAM_CLASS", dictRoleFunction.getExamClass());
//        map.put("FUN_ID", dictRoleFunction.getFunId());
//        uw.allEq(map, false);
//        return retBool(baseMapper.update(dictRoleFunction, uw));
//    }
//
//    @Override
//    public DictRoleFunction getInfo(DictRoleFunctionDto dto) {
//        QueryWrapper<DictRoleFunction> qw = new QueryWrapper();
//        Map<String, Object> map = new HashMap<>();
//        map.put("ROLE_ID", dto.getRoleId());
//        map.put("EXAM_CLASS", dto.getExamClass());
//        map.put("FUN_ID", dto.getFunId());
//        qw.allEq(map, false);
//        return baseMapper.selectOne(qw);
//    }
//
//    @Override
//    public int getCount(DictRoleFunctionDto dto) {
//        return baseMapper.getCount(dto);
//    }
//
//    @Override
//    public List<DictRoleFunctionDto> getRoleFunctionList(DictRoleFunctionDto dto) {
//        return baseMapper.getRoleFunctionList(dto);
//    }
//
//    @Override
//    public List<DictExamClass> getFunctionExamClass(DictRoleFunctionDto dto) {
//        return baseMapper.getFunctionExamClass(dto);
//    }
//
//    @Override
//    public boolean insertBatch(DictRoleFunction dictRoleFunction) {
//        List<String> funIds = CommonUtil.split2List(dictRoleFunction.getFunId());
//        for (String funId : funIds) {
//            dictRoleFunction.setFunId(funId);
//            baseMapper.insert(dictRoleFunction);
//        }
//        return true;
//    }
//}
